<?php
require_once("db/db_connector.php");
require_once("db/db_review.php");

$_POST["date"] = time();

// Database Access Begins ---------------------------------------- //
$con = get_db_con();
$result = insert_review($con, $_POST);
close_db_con();
// Database Access Ends ------------------------------------------ //

$paradise_id = $_POST["paradise_id"];

if ($result <= 0) {
	$error = 1;
}

$return_url = "paradise.php?id=$paradise_id";
if (isset($error)) {
	$return_url .= "&error=$error";
}

$return_url .= "#reviews";

header("Location: $return_url");